#include <bits/stdc++.h>
using namespace std;
const int N=1e5+4;
int n,m;
string s,t;
vector<int> f[N],g[N],h[N],ans;
int tp[2][N];
signed main(){
    freopen("seq.in","r",stdin);
    freopen("seq.out","w",stdout);
    cin>>s>>t;
    n=s.size(),m=t.size();
    s=' '+s,t=' '+t;
    for(int i=1;i<=m;i++) tp[t[i]-'0'][i]=1;
    for(int i=0;i<=n;i++) f[i].resize(m+1,0),g[i].resize(m+1,0),h[i].resize(m+1,0);
    g[0][0]=-1,h[0][0]=-1;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=m;j++){
            if(tp[s[i]-'0'][j]){
                if(g[i-1][j-1]) f[i][j]=g[i-1][j-1];
                if(h[i-1][j-1]) f[i][j]=h[i-1][j-1];
            }
        }
        if(i==n||s[i]==s[i+1]){
            for(int j=0;j<=m;j++)
                if(f[i][j]) h[i][j]=i;
                else h[i][j]=h[i-1][j];
        }
        else{
            g[i]=h[i-1];
            for(int j=0;j<=m;j++)
                if(f[i][j]) h[i][j]=i;
        }
    }
    if(!h[n][m]){
        cout<<"NO";
        return 0;
    }
    cout<<"YES\n";
    int pos=0;
    for(int i=n;i>=1&&!pos;i--)
        if(f[i][m]) pos=i;
    while(m){
        ans.push_back(pos);
        pos=f[pos][m--];
    }
    reverse(ans.begin(),ans.end());
    for(auto i:ans) cout<<i<<" ";
    return 0;
}
